#include <iostream>

char *char_remove(char *str, char ch)
{
    assert(str != NULL);
    char *pslow = str;
    char *pfast = str;
    while (*pfast != '\0') {
        if (*pfast != ch) {
            char tmp = *pslow;
            *pslow = *pfast;
            *pfast = tmp;
            pslow++;
            pfast++;
        } else {
            pfast++;
        }
    }
    return str;
}

int main(int argc, const char *argv[])
{
    char str[] = "I am a chinese, please get it.";
    std::cout << str << std::endl;
    std::cout << char_remove(str, 'a') << std::endl;
    std::cout << str << std::endl;
    return 0;
}
